package cn.mg.framework.exception;

import cn.mg.framework.response.ResponseCode;

/**
 * 自定义异常类型
 *
 * @author hezhaoming
 * @date 2019-10-31
 */

public class BusinessException extends RuntimeException {

    /**
     * 错误代码
     */
    private final ResponseCode resultCode;

    private Object data;

    public BusinessException(ResponseCode resultCode) {
        this.resultCode = resultCode;
    }

    public BusinessException(ResponseCode resultCode, Object data) {
        this.resultCode = resultCode;
        this.data = data;
    }

    public Object getData() {
        return data;
    }

    public ResponseCode getResultCode() {
        return resultCode;
    }


}
